/**
 * 
 */
package org.rvk.vms.web.controller.secure;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author Ashish Kumar Sinha <aksinha.mail@gmail.com>
 *
 */
@Controller
@RequestMapping(value="/secure/training")
public class TrainingController {
	
	@RequestMapping(value="/all")
	public ModelAndView all(HttpServletRequest request){
		request.setAttribute("page", "TRAINING");
		request.setAttribute("subpage", "ALL");
		
		ModelAndView modelAndView = new ModelAndView("secure/training/all") ;
		return modelAndView;
	}
	
	@RequestMapping(value="/search")
	public ModelAndView search(HttpServletRequest request){
		request.setAttribute("page", "TRAINING");
		request.setAttribute("subpage", "SEARCH");
		
		ModelAndView modelAndView = new ModelAndView("secure/training/search") ;
		return modelAndView;
	}
	
	@RequestMapping(value="/new")
	public ModelAndView newTraining(HttpServletRequest request){
		request.setAttribute("page", "TRAINING");
		request.setAttribute("subpage", "NEW");
		
		ModelAndView modelAndView = new ModelAndView("secure/training/new") ;
		return modelAndView;
	}
	
	@RequestMapping(value="/save")
	public ModelAndView save(HttpServletRequest request){
		request.setAttribute("page", "TRAINING");
		request.setAttribute("subpage", "ALL");
		//TODO - Add successful or failure message
		ModelAndView modelAndView = new ModelAndView("secure/training/all") ;
		return modelAndView;
	}
	
	@RequestMapping(value="/trainer")
	public ModelAndView allTraininers(HttpServletRequest request){
		request.setAttribute("page", "TRAINING");
		request.setAttribute("subpage", "TRAINER");
		
		ModelAndView modelAndView = new ModelAndView("secure/training/trainer") ;
		return modelAndView;
	}
	
	@RequestMapping(value="/grades")
	public ModelAndView grades(HttpServletRequest request){
		request.setAttribute("page", "TRAINING");
		request.setAttribute("subpage", "GRADES");
		
		ModelAndView modelAndView = new ModelAndView("secure/training/grades") ;
		return modelAndView;
	}
	
	@RequestMapping(value="/request")
	public ModelAndView trainingRequests(HttpServletRequest request){
		request.setAttribute("page", "TRAINING");
		request.setAttribute("subpage", "REQUEST");
		
		ModelAndView modelAndView = new ModelAndView("secure/training/request") ;
		return modelAndView;
	}
	
	
}
